package top.infopub.mgr.mkt.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.infopub.dto.mkt.RiskOverviewDto;
import top.infopub.mgr.common.vo.RspVo;
import top.infopub.mgr.mkt.service.RiskOverviewDtoService;
import top.infopub.tdp.sys.service.CodeGeneratorConfigService;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(("/riskOverview"))
public class RiskOverviewDtoController {

    @Autowired
    private RiskOverviewDtoService riskOverviewDtoService;

    @Autowired
    CodeGeneratorConfigService codeGeneratorConfigService;



    //跳转
    @RequestMapping("/toDealOrDetail")
    public String queryById(HttpServletRequest request, String proCode, String id) {
        request.setAttribute("proCode", proCode);
        request.setAttribute("id", id);
        System.out.println("proCode:"+proCode);
        return "mkt/lay-riskOverview-detail";
    }





    @RequestMapping("/queryDetail")
    @ResponseBody
    public RspVo queryDetail(String id) {
        RiskOverviewDto dto = riskOverviewDtoService.queryDetail(id);
        return RspVo.getSuccessResponse(dto);
    }
}
